package com.example.evanproject.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.evanproject.domain.Coursechapter;
import com.example.evanproject.service.CoursechapterService;
import com.example.evanproject.mapper.CoursechapterMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author hanxiaoqi
* @description 针对表【coursechapter】的数据库操作Service实现
* @createDate 2024-03-09 21:52:12
*/
@Service
public class CoursechapterServiceImpl extends ServiceImpl<CoursechapterMapper, Coursechapter>
    implements CoursechapterService{
    @Autowired
    private CoursechapterMapper courseChapterMapper;
    public List<Coursechapter> selectcourseallinfo(Integer fid){
        return courseChapterMapper.selectallinfo(fid);
    }

    public Integer addCourseChapter(Coursechapter courseChapter) {
        courseChapterMapper.addCourseChapter(courseChapter);
        return courseChapter.getScId();
    }

    @Override
    public List<Coursechapter> getallinfoByUserId(Integer fid, String userId) {
        return courseChapterMapper.getallinfoByUserId(fid,userId);
    }
}




